home *** CD-ROM | disk | FTP | other *** search
Java Source | 1996-09-04 | 1.3 KB | 59 lines | [TEXT/CWIE] |
- /*
- collection tester
-
- */
-
- import java.awt.*;
- import java.applet.*;
-
-
-
- public class FileTester extends Applet {
- protected boolean mTest;
-
-
- public void init () {
- test();
- }
-
- public void test() {
- Object obj;
- String s;
- try {
- SK8File testDir = new SK8File ("/Dream Police/");
- SK8File testFile = new SK8File ("/Dream Police/test file");
-
- System.out.println("testing file " + testDir);
-
- if (testDir.fileexists())
- System.out.println("Dream Police exists. CORRECT");
- else
- System.out.println("Dream Police does NOT exist. INCORRECT");
-
- if (testDir.isdirectory())
- System.out.println("Dream Police is a directory. CORRECT");
- else
- System.out.println("Dream Police is NOT a directory. INCORRECT");
-
- System.out.println("files: " + testFile.filenames());
-
- System.out.println("testing streams into " + testFile);
-
- String str = new String ("Hello cruel world");
-
-
- SK8TextStream stream = new SK8TextStream ( );
- stream.set_file(testFile);
-
- stream.set_direction("output");
- stream.writestring(str);
-
- stream.close();
-
-
- }
- catch (Exception e) {
- System.out.println(">> Error!" + e);
- }
- }
- }